package com.ganzalang.gmall.promotion.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author Ganzalang
 * @description 资格枚举
 * @Date 2022/4/5 11:04
 */
@Getter
@AllArgsConstructor
public enum QualifyEnum {

    /**
     * 首单
     */
    FIRST_ORDER(1, "首单");

    /**
     * 类型
     */
    private Integer type;
    /**
     * 中文描述
     */
    private String cnDesc;

    public static QualifyEnum valueOf(Integer type) {
        return Arrays.stream(QualifyEnum.values()).filter(item -> item.getType().equals(type)).findFirst().orElse(null);
    }
}
